package com.lhs.entity.blog;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "article_index")
public class article_search {
    /** 博客ID */
    @Id
    private Long id;

    /** 博客标题 */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String title;

    /** 博客展示图片 */
    private String cover;
    /** 博客标签 */
    @Field(type = FieldType.Keyword)
    private String label;

    /** 博客内容（列表页一般不返回全文，可以返回摘要） */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String content;

    /** 作者ID */
    private Long authorId;

    /** 作者昵称 */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String authorName;

    /** 作者头像 */
    private String authorAvatar;

    /** 博客状态 */
    private Integer status;
    /** 点赞数 */
    private Integer likeCount;

    /** 评论数 */
    private Integer commentCount;
    /** 浏览数 */
    private Integer viewCount;

    /** 发布时间 */
    private Date publishTime;

    /** 创建时间 */
    private Date createTime;

    /** 更新时间 */
    private Date updateTime;
}
